package org.pr.springboot_autodev.annatation.aspj;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * @ProjectName: SpringBoot_AutoDev
 * @Package: org.pr.springboot_autodev.annatation.aspj
 * @ClassName: LogAspj
 * @Author: LXC
 * @Description: 切面执行逻辑
 * @Date: 2025/8/29 14:50
 */
@Component
@Aspect
public class LogAspectJ {

    @Before(value = "@annotation(org.pr.springboot_autodev.annatation.SysLog)")
    public void before(JoinPoint joinPoint) {
        System.out.println("方法执行前执行!");
        System.out.println(Arrays.toString(joinPoint.getArgs()));
    }

    @After(value = "@annotation(org.pr.springboot_autodev.annatation.SysLog)")
    public void after(JoinPoint joinPoint) {
        System.out.println("方法执行后执行!");
        System.out.println(Arrays.toString(joinPoint.getArgs()));
    }
}
